#ifndef COMMON_H_
#define COMMON_H_

#include "scatu/Functions.h"
#include "scatu/ServerDefs.h"

namespace scatu {

enum TSide
    {
    EClient,
    EServer
    };

enum TMessageSlots
    {
    EMessageSlotData = 0,
    EMessageSlotBufSize = 1
    };

/* Panics */

enum TServerPanic
    {
    EPanicIllegalFunction = 1,
    EPanicAlreadyRequesting,
    EPanicTransactionAlreadyPrepared,
    EPanicTransactionNotPrepared
    };

static void PanicClient(const RMessagePtr2& aMessage, TServerPanic aPanic)
    {
    aMessage.Panic(KServerName(), aPanic);
    }

// To be specialized on server and client side separately, default implementation empty
template<TSide S, TServerFunction Function, typename ReturnType, typename ArgsType>
class RSynchronousRequest {};

// To be specialized on server and client side separately, default implementation empty
template<TSide S, TServerFunction Function, typename ReturnType, typename ArgsType>
class RAsynchronousRequest {};

} // namespace scatu

#endif /* COMMON_H_ */
